$(function() {

  $("#imageField").click(function() {
		// validate and process form
		// first hide any error messages
    $('.error').hide();
		var messageDelay = 2000;
	 if ( !$('#name').val() || !$('#email').val() || !$('#message').val() ) {

    // No; display a warning message and return to the form
    $('#incompleteMessage').fadeIn().delay(messageDelay).fadeOut();
    contactForm.fadeOut().delay(messageDelay).fadeIn();
return false;
  } 
		var name = $("input#name").val();
				var email = $("input#email").val();
		var message = $("input#message").val();

		var dataString = 'name='+ name + '&email=' + email + '&message=' + message;
		//alert (dataString);return false;
		
		$.ajax({
      type: "POST",
      url: "process.php",
      data: dataString,
      success: function() {
        $('#contact_form').html("<div id='message1'></div>");
        $('#message1').html("<h2>Your Message has been Submitted</h2>")
        .append("<p>We will be in touch soon.</p>")
        .hide()
        .fadeIn(1500, function() {
          $('#message1').append("<img id='checkmark' src='images/check.png' />");
        });
      }
     });
    return false;
	});
});
